package lumis.util.converter;

import java.util.Locale;

import lumis.portal.stability.StableMinor;

/**
 * Converter interface defines the methods converters must implement.
 * @since 4.0.4
 * @version $Revision: 13082 $ $Date: 2011-05-27 16:03:12 -0300 (Fri, 27 May 2011) $
 */
@StableMinor(version = "6.0", sinceVersion = "4.0")
public interface IConverter
{
	/**
	 * Converts the specified input object into an output object of the
	 * specified type.
	 *
	 * @param <T> generics support for the data type specified.
	 * @param type data type to which the value should be converted.
	 * @param value the input value to be converted.
	 * @param locale locale to be used during conversion, if necessary.
	 * @param pattern converter specific conversion pattern, to be used during conversion, if necessary.
	 * @since 4.0.4
	 */
	public <T> T convert(Class<T> type, Object value, Locale locale, String pattern);

	/**
	 * Converts the specified input object into an output object of the
	 * specified type.
	 *
	 * @param <T> generics support for the data type specified.
	 * @param type data type to which the value should be converted.
	 * @param value the input value to be converted.
	 * @param locale locale to be used during conversion
	 * @since 4.0.4
	 */
	public <T> T convert(Class<T> type, Object value, Locale locale);

	/**
     * Converts the specified input object into an output object of the
     * specified type.
     *
	 * @param <T> generics support for the data type specified.
     * @param type data type to which the value should be converted.
     * @param value the input value to be converted.
     * @since 4.0.4
     */
    public <T> T convert(Class<T> type, Object value);
}
